#include <REGX52.H>
#include <LED.h>
#include "timer.h"
#include "func.h"

unsigned int T0count = 0;

extern unsigned char Key1_Status;

void main(){
	Timer_0_Init();
//	Timer_1_Init();
	while(1){
		basic();
	}
}

void Timer_0_Rountine() interrupt 1
{
	TH0 = (M - time) / 256;
	TL0 = (M - time) % 256;
	T0count++;
	if(T0count == 125){
		T0count = 0;
		LED1 = ~LED1;
	}
}

void Timer_1_Rountine() interrupt 3{
	TH1 = (M - time) / 256;
	TL1 = (M - time) % 256;
	// 检测按键状态
	KeyCheck();
}